home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / kcl.lha / h / lex.h < prev    next >
Text File  |  1987-06-04  |  1KB  |  69 lines

  1. /*
  2. (c) Copyright Taiichi Yuasa and Masami Hagiya, 1984.  All rights reserved.
  3. Copying of this file is authorized to users who have executed the true and
  4. proper "License Agreement for Kyoto Common LISP" with SIGLISP.
  5. */
  6.  
  7. /*
  8.  
  9.     lex.h
  10.  
  11.     lexical environment
  12. */
  13.  
  14.  
  15. object *lex_env;
  16.  
  17. object Sfunction;
  18. object Smacro;
  19. object Stag;
  20. object Sblock;
  21.  
  22.  
  23. /*
  24.             VS
  25.         |        |
  26.         |---------------|
  27. lex_env ------> |    lex-var    |    : lex_env[0]
  28.         |---------------|
  29.         |    lex-fd    |       : lex_env[1]
  30.         |---------------|
  31.         |    lex-tag    |       : lex_env[2]
  32.         |---------------|
  33.         |        |
  34.         |        |
  35.         |        |
  36.  
  37.     lex-var:        (symbol value)          ; for local binding
  38.           (....       or          ....)
  39.             (symbol)                ; for special binding
  40.  
  41.     lex-fd:         (fun-name 'FUNCTION'   function)
  42.           (....        or                ...)
  43.             (macro-name 'MACRO' expansion-function)
  44.  
  45.     lex-tag:      (tag    'TAG'      frame-id)
  46.           (....        or                    ....)
  47.             (block-name 'BLOCK' frame-id)
  48.  
  49. where 'FUN' is the LISP object with pname FUN, etc.
  50.  
  51.  
  52. */
  53.  
  54. #define lex_copy()    ihs_top->ihs_base = vs_top;  \
  55.             vs_push(lex_env[0]);  \
  56.                       vs_push(lex_env[1]);  \
  57.                       vs_push(lex_env[2]);  \
  58.             lex_env = vs_top - 3
  59.  
  60. #define lex_new()    ihs_top->ihs_base = vs_top;  \
  61.             lex_env = vs_top;  \
  62.             vs_top[0] = vs_top[1] = vs_top[2] = Cnil;  \
  63.             vs_top += 3
  64.  
  65. #define lex_var_sch(name)    assoc_eq((name),lex_env[0])
  66.  
  67. #define lex_fd_sch(name)    assoc_eq((name),lex_env[1])
  68.  
  69.